﻿using Admin.Core.Common.BaseModel;
using Admin.Core.Model.Admin;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Admin.Core.Model.Quality
{
    /// <summary>
    /// 机台校验
    /// </summary>
    [Table(Name = "ZL_MACHINE_CHECK")]
    public class MachineCheckEntity : EntityAdd, IEntitySoftDelete
    {
        /// <summary>
        /// 校验类型  0 内部校验  1 外部校验
        /// </summary>
        [Column(Name = "CALTYPE")]
        public int CalType { get; set; }

        /// <summary>
        /// 计量编号
        /// </summary>
        [Column(Name = "CONTROLNO")]
        public string ControlNo { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        [Column(Name = "EQUIPMENTNAME")]
        public string EquipmentName { get; set; }

        /// <summary>
        /// 设备号
        /// </summary>
        [Column(Name = "EQUIPMENTNO")]
        public string EquipmentNo { get; set; }

        /// <summary>
        /// 序列号
        /// </summary>
        [Column(Name = "SERIALNO")]
        public string SerialNo { get; set; }
        
        /// <summary>
        /// 型号
        /// </summary>
        [Column(Name = "MODEL")]
        public string Model { get; set; }

        /// <summary>
        /// 精度
        /// </summary>
        [Column(Name = "ACCURACY")]
        public string Accuracy { get; set; }

        /// <summary>
        /// 参考文档
        /// </summary>
        [Column(Name = "REFERENCEDOC")]
        public string ReferenceDoc { get; set; }

        /// <summary>
        /// 使用部门
        /// </summary>
        [Column(Name = "DEPERMENTID")]
        public long DepermentId { get; set; }
        public DictionaryEntity Deperment { get; set; }


        /// <summary>
        /// 责任人
        /// </summary>
        [Column(Name = "OWNERID")]
        public long OwnerId { get; set; }
        public UserEntity Owner { get; set; }


        /// <summary>
        /// 计量周期
        /// </summary>
        [Column(Name = "CALNUM")]
        public int CalNum { get; set; }

        /// <summary>
        /// 计量周期单位  1年  2月
        /// </summary>
        [Column(Name = "CALINTERVAL")]
        public int CalInterval { get; set; }

        /// <summary>
        /// 计划校准时间
        /// </summary>
        [Column(Name = "PLANCALTIME")]
        public DateTime PlanCalTime { get; set; }


        /// <summary>
        /// 校准设备 内部校准
        /// </summary>
        [Column(Name = "CALIBRATIONEQUIPMENT")]
        public string CalibrationEquipment { get; set; }

        /// <summary>
        /// 未知字段 内部校准
        /// </summary>
        [Column(Name = "CONTROLITEM")]
        public string ControlItem { get; set; }


        /// <summary>
        /// 计划送检供应商
        /// </summary>
        [Column(Name = "PLANSUPPLIERID")]
        public long? PlanSupplierId { get; set; }
        public DictionaryEntity PlanSupplier { get; set; }

        public ICollection<CheckReportEntity> CheckReports { get; set; }

        /// <summary>
        /// 校准要求/范围
        /// </summary>
        [Column(Name = "CALIBRATIONREQ")]
        public string CalibrationReq { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [Description("是否删除")]
        [Column(Name = "ISDELETED")]//
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 启用
        /// </summary>
        [Column(Name = "ENABLED")]
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 备注
        /// </summary>
        [Column(Name = "REMARK")]//
        public string Remark { get; set; }



        /// <summary>
        /// 状态 -1正常 0 校验中  1 待确认  2 校验失败
        /// </summary>
        [Column(Name = "STATUS")]//
        public int Status { get; set; }
    }
}
